package com.config;

import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * 高版本eureka加入安全认证后，会开启CSRF跨站脚本攻击，禁用即可
 * @author c-fanqj
 * @date 2022/8/22
 * @apiNote
 */
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        //super.configure(http);
        http.csrf().ignoringAntMatchers("/eureka/**");
        super.configure(http);
    }
}
